//
//  AboutViewController.m
//  iRefuge
//
//  Created by Joe on 13-10-16.
//  Copyright (c) 2013年 Gee. All rights reserved.
//

#import "AboutViewController.h"

@interface AboutViewController ()
{
    UIImageView *up;
    UIImageView *down;
    UIImageView *c;
}

@end

@implementation AboutViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    [self.view setBackgroundColor:[UIColor colorWithRed:0.89 green:0.78 blue:0.84 alpha:1]];
	// Do any additional setup after loading the view.
     self.navigationController.navigationBar.translucent = NO;
    up = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"about_up.png"]];
    [up setFrame:CGRectMake(320, 0, 320, 458)];
    [up setAlpha:0];
    down = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"about_down.png"]];
    [down setFrame:CGRectMake(-320, 0, 320, 458)];
    [down setAlpha:0];
    c = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"about_c.png"]];
    [c setFrame:CGRectMake(0, 0, 320, 458)];
    [c setAlpha:0];
    
    [self.view addSubview:up];
    [self.view addSubview:down];
    [self.view addSubview:c];
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:YES];
    
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1.0];
    [up setFrame:CGRectMake(0, 0, 320, 458)];
    [up setAlpha:0.5];
    [down setFrame:CGRectMake(0, 0, 320, 458)];
    [down setAlpha:0.5];
    [UIView setAnimationWillStartSelector:@selector(animation_1)];
    [UIView setAnimationDelegate:self];
    [UIView commitAnimations];
}

- (void)animation_1
{
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.5];
    [UIView setAnimationDelay:0.7];
    [c setAlpha:0.5];
    [UIView commitAnimations];
}

- (void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:YES];
    [up setFrame:CGRectMake(320, 0, 320, 458)];
    [up setAlpha:0];
    [down setFrame:CGRectMake(-320, 0, 320, 458)];
    [down setAlpha:0];
    [c setAlpha:0];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
